import { ApiCall } from "tsrpc";
import { ReqOut, ResOut } from "../../../shared/master/team/PtlOut";
import { player } from "../../../model/fight/body/player";
import { team } from "../../model/lib/team";
import { template } from "../../../shared/master/MsgAction";

export default async function (call: ApiCall<ReqOut, ResOut>) {
    call.succ({})
    let user = call.req._player as player;
    let _team = user.get_team() as team;
    if(_team){
        _team.out(user.uuid);
    }
    user.update_team()
    user.sendMsg(template.default,`已退出${_team.name}`)
}